//
//  RootViewController.m
//  通讯录
//
//  Created by dllo on 16/1/12.
//  Copyright © 2016年 YYL. All rights reserved.
//

#import "RootViewController.h"
#import "LTView.h"
@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];
    
    
    NSArray *nameArr = @[@"路飞", @"索隆", @"乌索普", @"山治", @"娜美", @"乔巴", @"罗宾", @"弗兰奇"];
    NSArray *phoneArr = @[@"123", @"456", @"789", @"111", @"222", @"333", @"444", @"555"];
    
    for (int i = 1; i < 9; i++) {
        LTView *person = [[LTView alloc] initWithFrame:CGRectMake(0, 20 + 200 * (i - 1), self.view.frame.size.width, 200)];
        
        person.name.text = nameArr[i - 1];
        person.phone.text = phoneArr[i - 1];
        person.headImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%d", i]];
        
        [scrollView addSubview:person];
        [person release];
    }

    scrollView.contentSize = CGSizeMake(0, 200 * 8);
    
    
    [self.view addSubview:scrollView];
    [scrollView release];
    



}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
